separated the initialize() method fixes #79 #81
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In
robotis_controller
theinitialize()
method automatically creates aRobot
instance with the information provided in the configuration files. There is no way for the user to provide additional functionality before the rest of the function interrogates the communication ports and completes the initialisation process.I have created a second
initialize()
method that uses aRobot *
and now the originalinitialize()
method simply creates the newRobot
instance and calls the new method that contains all the original code from after the robot instance creation.With this structure it is now possible in a custom controller node to perform this:
Of course other scenarios are possible like creating a subclass of
robotis_framework::Robot
with some special functionality that is not included in the original class and using that in the creation of the robot instance, then passing it to theinitialize(robot, init_file)
.